#include<bits/stdc++.h>
#define int long long
#define N 3000005
using namespace std;
int n;
int a[N];
int ans[N];
signed main(){
    freopen("mcmf.in","r",stdin);
    freopen("mcmf.out","w",stdout);
    scanf("%lld",&n);
    for(int i=1,k;i<=n;i++){
        scanf("%lld",&k);
        for(int j=1;j<=k;j++) scanf("%lld",&a[i]),a[i]--;
    }
    sort(a+1,a+n+1);
    int o=0;
    for(int i=1;i<=n;i++){
        o=max(o,a[i]);
        ans[o]=1;
        o++;
    }
    for(int i=o-1;i>=0;i--) printf("%lld",ans[i]);
    return 0;
}